Repository navigation
fix(ci): repair the SSO locators #33575 dropped, and stop SearchIndexRetryQueueIT racing the app's retry worker - #33646
Conversation
…ation #33575 migrated the unauthenticated screens to `@openmetadata/ui-core-components` and took two selectors with it. It updated the Playwright helpers the PR lane runs, but not the SSO ones, which only execute in the nightly matrix -- so both breakages landed green and surface as nightly/PR failures now. 1. `button.signin-button`. `LoginButton` swapped antd for the core `Button` and `className="signin-button m-x-auto"` for Tailwind utilities, so that class exists nowhere in `src/` any more and the locator matches nothing: expect(locator).toBeVisible() failed Locator: locator('button.signin-button') Error: element(s) not found The component carries `data-testid="sso-login-button"`, which core `Button` spreads onto the real `<button>`, so use that at all four call sites. This is what fails SSOSessionLimit "should evict the least-recently-used session once the cap is exceeded": the `waitForURL('**/signin')` before it passes -- eviction works -- and only the button assertion after it breaks. 2. `full-name-input`. The signup screen now builds that field from the core `Input`, whose react-aria `TextField` puts the test id on the wrapper `<div data-input-wrapper>` rather than on the control, so `fill()` throws: locator.fill: Element is not an <input>, <textarea>, <select> ... locator resolved to <div data-rac data-input-wrapper="true" data-testid="full-name-input" ...> Reach the control the way the rest of the corpus already does for these wrappers (`getByTestId(...).locator('input')`, as in lineage.ts, glossary.ts and dataQuality.ts), which also keeps the test id where SignUpPage.test.tsx's `.querySelector('input')` expects it. This is what fails all five keycloak-oidc-public scenarios; the `inputValue().catch(() => '')` above the fill swallowed the same error first, which is why it surfaced one line later as a confusing fill() error rather than where the locator went wrong. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ueIT
`testUpdateFailureAndRetryCountIncrementsCountAndRetainsAttemptTime` fails
intermittently on the retry-queue lane:
java.util.NoSuchElementException: No value present
at SearchIndexRetryQueueIT.java:446
The test writes a row, moves it back to PENDING, reads PENDING back and expects
to find it. The row is gone because `OpenMetadataApplication` registers an
always-on `SearchIndexRetryWorker` -- four threads polling the shared
`search_index_retry_queue` table every five seconds -- and `claimPending()`
takes *every* row it finds in PENDING / PENDING_RETRY_1 / PENDING_RETRY_2,
flipping it to IN_PROGRESS and deleting it once processed. It lands in the
window between the write and the read.
The CI log shows it plainly: "Started search index retry worker with 4 consumer
threads" at 01:12:50, before the class begins, and the matching "Stopped" only
at Dropwizard shutdown at 01:13:37 -- so the application worker was live for
every test in between.
This is not a load problem, and the `LIMIT 1000` on the read is not the cause:
the retry-queue lane runs this class and nothing else, the class is
`SAME_THREAD`, and `@BeforeEach` truncates the queue, so there is no second
writer that could push the row past the cap in the 23ms the test took.
The class has been patched for this same worker twice before -- one test picks
statuses "that the background SearchIndexRetryWorker does not claim", another
counts a row as handled by "ANY worker ... or the always-on application worker
sharing the global queue" -- so fix the cause instead of the next symptom:
pause that worker for the duration of the class and restart it afterwards.
Nothing here depends on it running. The six worker tests construct and start
their own worker, and the DAO-level tests want no worker at all; roughly half of
them assert on rows in a claimable status and were racing it the same way.
`TestSuiteBootstrap.findManagedObject` unwraps Dropwizard's `JettyManaged` to
reach the instance the application built. It returns `Optional`, and the caller
fails loudly if the worker is absent rather than silently going back to racing
one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟡 Medium risk Repairs two SSO Playwright locators invalidated by the core-components migration (#33575) and eliminates a race condition in SearchIndexRetryQueueIT by pausing the application's retry worker for the duration of the test class. No issues found. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 4538 passed · ❌ 0 failed · 🟡 7 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 50m 44s ⏱️ Max setup 4m 48s · max shard execution 23m 39s · max shard-job elapsed before upload 26m 47s · reporting 18s 🌐 225.39 requests/attempt · 2.23 app boots/UI scenario · 41.51% common-shard skew Optimization targets still in progress:
🟡 7 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Three conflicts, one hunk each, all resolved keeping both sides' intent:
- SSOSessionLimit.spec.ts: both sides had already converged on
getByTestId('sso-login-button') -- #33646 landed the same fix on main --
so the only conflict was this branch's waitUntil: 'domcontentloaded'
hardening. Kept it; the unconflicted survivor.reload() two lines below
uses the same pattern.
- SearchIndexRetryQueueIT.java: kept this branch's Isolated import. main
never had @isolated -- it stops the worker race with
pauseApplicationRetryWorker() instead -- but the annotation survives in
the merged body, so dropping the import would not compile. The two
guards are complementary, not alternatives.
- TestSuiteBootstrap.java: took main's Managed import. Its new
findManagedObject(Class<T>) declares <T extends Managed> and merged in,
so the import is load-bearing.
Verified: no conflict markers in the tree, spotless:check passes on
openmetadata-integration-tests, prettier and eslint clean on the resolved
spec, and the corpus still enumerates 4667 tests in 407 files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… primitives (open-metadata#33651) * ci(sso): extend PR-lane paths to login/signup pages and the core Button/Input primitives The SSO nightly's `pull_request` paths already trigger on the SSO fixtures, the AuthCoordinator/AuthProvider surface, and the backend auth handlers — but NOT on the login/signup pages themselves nor on the `@openmetadata/ui-core-components` primitives those pages render. That gap let open-metadata#33575 (antd → core-components migration for the unauthenticated screens) merge green: its own Playwright lane only ran non-SSO specs, and the SSO fixtures — which live in a nightly-only lane — never executed. The migration dropped the `.signin-button` class the fixtures selected on, and moved the `full-name-input` testid onto a wrapper `<div>` so `.fill()` threw. Both broke as soon as the nightly ran; open-metadata#33646 fixed the locators after the fact. Adding these paths brings the SSO matrix into any PR that touches: - `pages/{LoginPage,SignUp,ForgotPassword,ResetPassword}/**` — the actual auth screens the fixtures drive. - `components/common/LoginButton/**` — the sign-in button whose DOM shape the fixture depends on. - `ui-core-components/.../base/{buttons,input}/**` — the shared primitives that emit the DOM the fixtures select on (this is the cross-package breakage open-metadata#33575 was — catching it on the originating PR is the whole point of this change). - `playwright/utils/ssoLogin.ts` — belt-and-braces so an edit to the fixture helper itself always runs the matrix. Every provider fixture still self-gates on `isAvailable()` via required secrets, so fork PRs without live-tenant credentials short-circuit cleanly per leg — the added paths don't turn Okta or Keycloak-crosssite into hard failures on the PR lane. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci(sso): extend PR-lane paths to form / form-field primitives Greptile r4056182832: the Basic and LDAP fixtures locate inputs via `getByLabel(/email/i)` and `getByLabel(/password/i)` — labels emitted from `components/base/form/**` and `components/application/form-field/ render-field-element.tsx`. A migration that reshapes those wrappers can invalidate the same fixtures the Button/Input paths already cover, so they belong on the same trigger. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Describe your changes:
Fixes #33647
Three CI checks currently fail. None of them is caused by the code under test — two are
Playwright locators that a merged UI migration invalidated, and one is an integration test
racing a background worker the application starts. They were found on #33631 but are
properties of
main, so they are fixed here on their own.Type of change:
High-level design:
1.
fix(e2e)— two selectors that #33575 deleted.#33575 migrated the
unauthenticated screens to
@openmetadata/ui-core-components. It updated the Playwrighthelpers the PR lane runs (
Login.spec.ts,UserClass.ts,admin.ts,user.ts) but not theSSO ones, which only execute in the nightly matrix — so both breakages merged green.
button.signin-buttonLoginButtonswapped antd for the coreButton, replacingclassName="signin-button m-x-auto"with Tailwind utilities. The class now exists nowhere insrc/—grep -r signin-button src/returns nothing — so the locator matches nothing.getByTestId('sso-login-button'), which the component already carries and coreButtonspreads onto the real<button>. 4 call sites.full-name-inputInput; its react-ariaTextFieldputs the test id on the wrapper<div data-input-wrapper>, not on the control, sofill()throws "Element is not an<input>".getByTestId('full-name-input').locator('input')— the convention the rest of the corpus already uses for these wrappers (lineage.ts,glossary.ts,dataQuality.ts), and the oneSignUpPage.test.tsxalready relies on via.querySelector('input').I swept #33575's whole diff for other casualties: every other
data-testidit removed(
bg-image,brand-image,confirm-password,email,email-input,email-label,full-name-label,password,username-label) and every non-Tailwind class it removed. Theonly Playwright references left pointing at something that no longer exists are the five fixed
here; the
email/email-inputhits are on authenticated screens this PR did not touch.2.
test(it)—SearchIndexRetryQueueITraces the always-on retry worker.testUpdateFailureAndRetryCountIncrementsCountAndRetainsAttemptTimewrites a row, moves itback to
PENDING, readsPENDINGback, and expects to find it. The row is gone becauseOpenMetadataApplicationregisters an always-onSearchIndexRetryWorker— four threadspolling the shared
search_index_retry_queuetable every five seconds — andclaimPending()takes every row it finds in
PENDING/PENDING_RETRY_1/PENDING_RETRY_2, flipping it toIN_PROGRESSand deleting it once processed. It lands in the window between the write and theread.
The failing CI log shows it directly:
Started search index retry worker with 4 consumer threadsat01:12:50, before the class begins, with the matchingStoppedonly at Dropwizardshutdown at
01:13:37— live for every test in between.It is worth saying what this is not. It is not a load problem, and the
LIMIT 1000on theread is not the cause: the
retry-queuelane runs this class and nothing else, the class is@Execution(SAME_THREAD), and@BeforeEachtruncates the queue — so no second writer can pushthe row past the cap in the 23 ms the test took.
The class has already been patched for this same worker twice, each time around a single
symptom — one test picks statuses "that the background
SearchIndexRetryWorkerdoes notclaim", another counts a row as handled by "ANY worker … or the always-on application worker
sharing the global queue". Roughly half the DAO-level tests still assert on rows in a claimable
status and are racing it the same way; this one just lost the race first. So this fixes the
cause: pause that worker for the duration of the class, restart it in
@AfterAll.Nothing here depends on it running — the six worker tests construct and start their own worker,
and the DAO-level tests want no worker at all.
TestSuiteBootstrap.findManagedObjectunwrapsDropwizard's
JettyManagedto reach the instance the application built; it returns anOptionaland the caller fails loudly if the worker is ever absent, rather than silently goingback to racing one.
Backward compatibility / migration: none. Test-only — no production source, schema or
bootstrap/sqlchange.Tests:
Use cases covered
silent refresh — all five reach the signup screen and fill the display name.
SearchIndexRetryQueueIT: all 35 tests, deterministic rather than dependent on whether theapplication worker happens to poll inside the window.
Backend integration tests
itself:
-DintegrationTests.lane=retry-queuerunsSearchIndexRetryQueueITalone against areal server, which is exactly the configuration that was failing.
Playwright (UI) tests
this PR: it touches
playwright/e2e/Auth/**andplaywright/utils/sso-providers/**, whichare on the SSO Login Nightly
pull_requesttrigger.Verification performed
Every claim above was checked against the tree rather than assumed:
signin-buttonno longer existsgrep -r signin-buttonoversrc/— zero hits; only the 4 Playwright call sitessso-login-buttonreaches a real<button>LoginButton.tsxsets it; corebutton.tsxspreads...otherPropsontoAriaButtoninput.tsx'sTextFieldspreads props ontoAriaTextField+data-input-wrapper; matches the<div …>in the CI error.locator('input')is the house conventionSignUpPage.test.tsx's.querySelector('input')OpenMetadataApplication.java:468registers it; CI log start/stop timestamps bracket the whole classretryQueueTests=SearchIndexRetryQueueIT; excluded from the parallel execution;parallel.enabled=falsejavapondropwizard-lifecycle:5.0.0/dropwizard-core:5.0.0:LifecycleEnvironment#getManagedObjects(),JettyManaged#getManaged(),Environment#lifecycle(),DropwizardAppExtension#getEnvironment()google-java-format(GOOGLE style, javadoc formatting off) reports both Java files clean;prettier@2.8.8reports all five TS files cleanI could not execute either suite in my sandbox — the SSO legs need the Keycloak/OM docker stack
and the IT lane needs testcontainers, neither of which runs there. CI on this PR is the
execution, and it exercises both.
Is this failing on
maintoo?Yes for SSO, by construction:
maincarries #33575 and neither locator fix, and the class thetests look for is not in the tree. (A
workflow_dispatchof SSO Login Nightly onmainiseasy to misread here — its
sso_providerinput defaults tookta, so both keycloak legs reportgreen having been skipped, not run.)
The retry-queue failure is on
maintoo —SearchIndexRetryQueueITis byte-identical onmainand on the branch it was seen on. It is timing-dependent, so a single green
mainrun neitherconfirms nor clears it; the interleaving that produces it is what the diagnosis above pins down.
UI screen recording / screenshots:
Not applicable — no production UI code changes, only Playwright selectors.
Checklist:
🤖 Generated with Claude Code
The PR appears safe to merge; the new locators match the migrated DOM and the retry-worker lifecycle change correctly isolates the dedicated integration-test lane.
Summary
This PR repairs SSO Playwright locators invalidated by the core-component migration and isolates retry-queue integration tests from the application’s background retry worker.
signin-buttonclass selector with the existingsso-login-buttontest ID.SearchIndexRetryQueueITand restarts it after the class.Diagram
sequenceDiagram participant JUnit as SearchIndexRetryQueueIT participant Bootstrap as TestSuiteBootstrap participant AppWorker as Application Retry Worker participant TestWorker as Test-owned Retry Worker JUnit->>Bootstrap: findManagedObject(SearchIndexRetryWorker) Bootstrap-->>JUnit: managed application worker JUnit->>AppWorker: stop() loop Retry-queue tests JUnit->>JUnit: exercise DAO operations opt Worker behavior test JUnit->>TestWorker: start() TestWorker->>TestWorker: process test queue records JUnit->>TestWorker: stop() end end JUnit->>AppWorker: start()Reviews (1) · Last reviewed commit: "test(it): pause the application's retry ..."